package org.arch_learn.global_session.spring_redis_session;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;

@EnableRedisHttpSession
@SpringBootApplication
@EnableCaching
//打成war包需要继承SpringBootServletInitializer类并重写configure方法
public class SpringRedisSessionApplication extends SpringBootServletInitializer {
    public static void main(String[] args) {
        SpringApplication.run(SpringRedisSessionApplication.class, args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(SpringRedisSessionApplication.class);
    }
}
